//构造函数模式优化
function Person(name){
    this.name=name;
    this.getName=getName;
}
function getName(){
    console.log(this.name)
}
var person=new Person('zhangwang')
console.log(person.getName())